Repository navigation
fix: clear stale obstacle predictions and re-record the demo videos - #6
Merged
Merged
Conversation
record_scenarios.py renders RViz in software when recording on a virtual display, which is CPU-heavy: under that load RViz draws at 8-18 fps, so every clip repeats frames, and the contention also slows the local costmap's obstacle clearing. --gpu-offload sets NVIDIA PRIME render offload for the rviz2 process alone (__NV_PRIME_RENDER_OFFLOAD=1, __GLX_VENDOR_LIBRARY_NAME=nvidia), so the Nav2 stack keeps its environment. It needs a real X server running the NVIDIA driver; a virtual Xvfb display has no hardware GL to offload to. Off by default, so existing invocations are unchanged.
The 2.0.0 entry marks warm_start's new default as breaking but not max_iter_sqp's, though both change solver behaviour for a deployment that relied on the previous defaults: max_iter_sqp now defaults to 1 instead of 100. Bloom builds the Debian changelog from this file at the tagged commit, so the marker has to be in place before v2.0.0 is tagged.
The README called the predictive path the default. Only predict_obstacles defaults on; the 6 % collision result also depends on the obstacle-aware yield, its speed cap and allow_reversing, which are all off by default and set in the predictive preset. A deployment that kept the defaults would not get the behaviour the comparison measured.
On a desktop session the window manager keeps a managed window off its panels, so moving RViz to the capture origin leaves the dock, the top bar and the window's own title bar inside the grab. --fullscreen starts RViz fullscreen, which shows the 3D view alone, and skips the xdotool placement a fullscreen window does not need. Pair it with --resolution at the full screen size: the grid combiner scales every clip to its cell, so a native-resolution capture needs no other change. Off by default, so Xvfb recordings are unchanged.
The previous grid was captured on a virtual Xvfb display, where RViz renders with llvmpipe on the CPU alongside the Nav2 stack. It drew far below the capture rate, so only 14-22% of the frames were unique and the clips looked choppy, and one take showed predicted obstacle paths detached from their obstacles. - Re-record the four scenarios on the Xorg desktop, RViz fullscreen and rendered on the NVIDIA GPU, and rebuild the grid mp4 and GIF. - Unique frames rise to 55-88% per clip; the predicted paths of both moving obstacles start within 0.17 m of the ground-truth position. - Describe the fullscreen GPU recording as the way the bundled clips are made, and why a windowed or Xvfb capture falls short.
The predicted-obstacle markers were cleared only at the start of the next control cycle. The controller server stops cycling when a task ends, so RViz kept drawing the last prediction after the goal while the obstacle moved on. - reset(), which the controller server calls when a task ends, clears the predictions and publishes a DELETEALL while the publisher is active, and stays silent once it is deactivated. - Add a unit test, a CHANGELOG entry and a note in the interface table.
The previous grids showed a predicted obstacle path frozen after the goal, fixed in the controller by clearing it on reset, and the four-controller grids were still CPU-rendered, windowed captures with the RViz panels in frame. - Re-record the four ProxMPC clips with the fix, fullscreen on the GPU, and the DWB, MPPI and RPP clips the same way. - Rebuild the demo grid and the four controller grids; every clip reached its goal, with 49-89% unique frames against 11-22% before. - Verified from a bag per ProxMPC take: the predicted paths start within 0.16 m of the obstacle while the robot moves and are cleared once the goal is reached.
The multi-controller recording examples still used the plain command, which on a desktop session records a windowed RViz with its panels in frame. Pass the same display, fullscreen and GPU offload flags the bundled grids were recorded with.
- --gpu-offload and --fullscreen land before v2.0.0 is tagged, so they ship in 2.0.0 and belong in its changelog entry.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Follow-up to #5, to land before
v2.0.0is tagged. The demo videos showed a controller bug: the predicted obstacle path stayed on screen after the robot reached its goal. This PR fixes that bug and re-records every demo video. It also adds two recorder options used to make those videos, and makes two docs corrections.Controller fix
/prox_mpc_predicted_obstacles) only at the start of the next control cycle, and the markers never expire. Nav2 stops running control cycles once a task ends, so RViz kept showing the last prediction for several seconds after the goal while the obstacle moved on. This has been present since 1.0.0.reset()now clears the stored predictions and publishes aDELETEALL. The controller server callsreset()when a task ends: on success, on failure and on deactivate. The publish is skipped while the publisher is deactivated, so the lifecycle publisher logs no warning.Recording (
prox_mpc_benchmark)record_scenarios.py --gpu-offloadrenders RViz on the NVIDIA GPU through PRIME render offload, for RViz only. It is opt-in and needs a real X server.record_scenarios.py --fullscreenstarts RViz fullscreen and skips window placement, so the dock, top bar and title bar stay out of the capture.Media
Docs
prox_mpc_coreCHANGELOG: themax_iter_sqpdefault change is marked Breaking.predict_obstaclesis on by default. The benchmark result also relies onobstacle_yield_band_m,obstacle_yield_caps_speedandallow_reversing, which are off by default and set in the predictive preset.prox_mpc_benchmark2.0.0 CHANGELOG lists them.Type of change
Behavioral impact
obstacle_yield_band_m > 0, set by the predictive preset) reads the predictions kept from the previous cycle before this cycle's fill replaces them. Becausereset()now empties them, the first control cycle of a new task no longer slows for predictions left over from the previous task, which can be arbitrarily old.deactivate()already cleared them the same way. From the second cycle on, nothing changes. Benchmark results are unaffected: every benchmark run launches a fresh Nav2 stack with a single goal, so no run has a previous task.NoValidControlescalation, the non-finite-command guard, the footprint veto, obstacle keep-out constraints, or the tracker's lifecycle teardown guard)? No. The keep-out constraints are still rebuilt from fresh tracker data every cycle, before the solve.Verification
colcon build --symlink-installpassescolcon testpasses with no new failuresResetClearsDrawnObstaclePredictionschecks that a drawn prediction is cleared byreset(), and that a deactivated controller publishes nothing. Three recorder tests cover the new options.Reproduction: recorded 16 mode (b2) takes (4 scenarios × ProxMPC, DWB, MPPI, RPP) on the kinematic plant with the full Nav2 stack. For every ProxMPC take a bag of
/odom,/tracked_obstaclesand/prox_mpc_predicted_obstacleswas checked against the scenario's true obstacle path. All 16 goals succeeded.The workspace run above was on
5689173; the two commits after it change only docs and theprox_mpc_benchmarkCHANGELOG. The 57 skipped are cppcheck skips.Checklist
package.xmlandCMakeLists.txtupdated if dependencies changed, and a row added toTHIRD_PARTY_LICENSES.mdfor any new dependency: no dependencies changed.CHANGELOG.rstupdated for the affected package(s):prox_mpc_controller,prox_mpc_core,prox_mpc_benchmark.